
function Utils() {
    "use strict";
    
    this.self = this;
    
    this.standardModClasses = ["nomod", "alt", "command", "control", "shift", "multi", "other"];

    // Maps byte to names defined in /shmaplib/keynames
    // It's important that these names are exactly the same
    this.keyCodeMap = {
        8: "BACKSPACE",
        9: "TAB",
        13: "RETURN",
        16: "SHIFT",
        17: "CONTROL",
        18: "ALT",
        19: "PAUSEBREAK",
        20: "CAPSLOCK",
        27: "ESCAPE",
        32: "SPACE",
        33: "PAGEUP",
        34: "PAGEDOWN",
        35: "END",
        36: "HOME",
        37: "LEFT",
        38: "UP",
        39: "RIGHT",
        40: "DOWN",
        43: "PLUS",
        44: "PRINTSCREEN",
        45: "INSERT",
        46: "DELETE",
        48: "ZERO",
        49: "ONE",
        50: "TWO",
        51: "THREE",
        52: "FOUR",
        53: "FIVE",
        54: "SIX",
        55: "SEVEN",
        56: "EIGHT",
        57: "NINE",
        59: "SEMICOLON",
        61: "EQUAL",
        65: "A",
        66: "B",
        67: "C",
        68: "D",
        69: "E",
        70: "F",
        71: "G",
        72: "H",
        73: "I",
        74: "J",
        75: "K",
        76: "L",
        77: "M",
        78: "N",
        79: "O",
        80: "P",
        81: "Q",
        82: "R",
        83: "S",
        84: "T",
        85: "U",
        86: "V",
        87: "W",
        88: "X",
        89: "Y",
        90: "Z",
        91: "COMMAND",
        93: "COMMAND",
        224: "COMMAND",
        96: "NUMPAD_ZERO",
        97: "NUMPAD_ONE",
        98: "NUMPAD_TWO",
        99: "NUMPAD_THREE",
        100: "NUMPAD_FOUR",
        101: "NUMPAD_FIVE",
        102: "NUMPAD_SIX",
        103: "NUMPAD_SEVEN",
        104: "NUMPAD_EIGHT",
        105: "NUMPAD_NINE",
        106: "NUMPAD_ASTERISK",
        107: "NUMPAD_PLUS",
        109: "NUMPAD_MINUS",
        110: "NUMPAD_PERIOD",
        111: "NUMPAD_SLASH",
        112: "F1",
        113: "F2",
        114: "F3",
        115: "F4",
        116: "F5",
        117: "F6",
        118: "F7",
        119: "F8",
        120: "F9",
        121: "F10",
        122: "F11",
        123: "F12",
        144: "NUMLOCK",
        145: "SCROLLLOCK",
        186: "SEMICOLON",
        187: "NUMPAD_EQUAL",
        188: "COMMA",
        189: "MINUS",
        190: "PERIOD",
        191: "SLASH",
        192: "ACCENT_GRAVE",
        219: "LEFT_BRACKET",
        220: "BACKSLASH",
        221: "RIGHT_BRACKET",
        222: "SINGLE_QOUTE"
    };
    
};

window.utils = new Utils();
